package com.yicong.ants.bean.scenic;

import com.cchao.simplelib.core.CollectionHelper;
import com.cchao.simplelib.util.StringHelper;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * 二次消费的项目
 *
 * @author cchao
 * @version 2019-08-22.
 */
public class AddedItem {
    String id;
    String thumbnail;
    List<String> images;
    String project_name;
    String purchase_notes;
    String description;
    String web_url;
    String current_price;
    String original_price;
    String start_date;
    float coin;
    String end_date;

    public AddedItem() {
    }

    public String getStart_date() {
        if (StringHelper.isEmpty(start_date)) {
            return new SimpleDateFormat("yyyy-MM-dd").format(new Date());
        }
        return start_date;
    }

    public String getThumbnail() {
        if (StringHelper.isNotEmpty(thumbnail)) {
            return thumbnail;
        }
        if (CollectionHelper.isNotEmpty(images)) {
            return images.get(0);
        }
        return "";
    }

    public String getId() {
        return this.id;
    }

    public List<String> getImages() {
        return this.images;
    }

    public String getProject_name() {
        return this.project_name;
    }

    public String getPurchase_notes() {
        return this.purchase_notes;
    }

    public String getDescription() {
        return this.description;
    }

    public String getWeb_url() {
        return this.web_url;
    }

    public String getCurrent_price() {
        return this.current_price;
    }

    public String getOriginal_price() {
        return this.original_price;
    }

    public float getCoin() {
        return this.coin;
    }

    public String getEnd_date() {
        return this.end_date;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setThumbnail(String thumbnail) {
        this.thumbnail = thumbnail;
    }

    public void setImages(List<String> images) {
        this.images = images;
    }

    public void setProject_name(String project_name) {
        this.project_name = project_name;
    }

    public void setPurchase_notes(String purchase_notes) {
        this.purchase_notes = purchase_notes;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void setWeb_url(String web_url) {
        this.web_url = web_url;
    }

    public void setCurrent_price(String current_price) {
        this.current_price = current_price;
    }

    public void setOriginal_price(String original_price) {
        this.original_price = original_price;
    }

    public void setStart_date(String start_date) {
        this.start_date = start_date;
    }

    public void setCoin(float coin) {
        this.coin = coin;
    }

    public void setEnd_date(String end_date) {
        this.end_date = end_date;
    }

    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof AddedItem)) return false;
        final AddedItem other = (AddedItem) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$id = this.getId();
        final Object other$id = other.getId();
        if (this$id == null ? other$id != null : !this$id.equals(other$id)) return false;
        final Object this$thumbnail = this.getThumbnail();
        final Object other$thumbnail = other.getThumbnail();
        if (this$thumbnail == null ? other$thumbnail != null : !this$thumbnail.equals(other$thumbnail))
            return false;
        final Object this$images = this.getImages();
        final Object other$images = other.getImages();
        if (this$images == null ? other$images != null : !this$images.equals(other$images))
            return false;
        final Object this$project_name = this.getProject_name();
        final Object other$project_name = other.getProject_name();
        if (this$project_name == null ? other$project_name != null : !this$project_name.equals(other$project_name))
            return false;
        final Object this$purchase_notes = this.getPurchase_notes();
        final Object other$purchase_notes = other.getPurchase_notes();
        if (this$purchase_notes == null ? other$purchase_notes != null : !this$purchase_notes.equals(other$purchase_notes))
            return false;
        final Object this$description = this.getDescription();
        final Object other$description = other.getDescription();
        if (this$description == null ? other$description != null : !this$description.equals(other$description))
            return false;
        final Object this$web_url = this.getWeb_url();
        final Object other$web_url = other.getWeb_url();
        if (this$web_url == null ? other$web_url != null : !this$web_url.equals(other$web_url))
            return false;
        final Object this$current_price = this.getCurrent_price();
        final Object other$current_price = other.getCurrent_price();
        if (this$current_price == null ? other$current_price != null : !this$current_price.equals(other$current_price))
            return false;
        final Object this$original_price = this.getOriginal_price();
        final Object other$original_price = other.getOriginal_price();
        if (this$original_price == null ? other$original_price != null : !this$original_price.equals(other$original_price))
            return false;
        final Object this$start_date = this.getStart_date();
        final Object other$start_date = other.getStart_date();
        if (this$start_date == null ? other$start_date != null : !this$start_date.equals(other$start_date))
            return false;
        if (Float.compare(this.getCoin(), other.getCoin()) != 0) return false;
        final Object this$end_date = this.getEnd_date();
        final Object other$end_date = other.getEnd_date();
        if (this$end_date == null ? other$end_date != null : !this$end_date.equals(other$end_date))
            return false;
        return true;
    }

    protected boolean canEqual(final Object other) {
        return other instanceof AddedItem;
    }

    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $id = this.getId();
        result = result * PRIME + ($id == null ? 43 : $id.hashCode());
        final Object $thumbnail = this.getThumbnail();
        result = result * PRIME + ($thumbnail == null ? 43 : $thumbnail.hashCode());
        final Object $images = this.getImages();
        result = result * PRIME + ($images == null ? 43 : $images.hashCode());
        final Object $project_name = this.getProject_name();
        result = result * PRIME + ($project_name == null ? 43 : $project_name.hashCode());
        final Object $purchase_notes = this.getPurchase_notes();
        result = result * PRIME + ($purchase_notes == null ? 43 : $purchase_notes.hashCode());
        final Object $description = this.getDescription();
        result = result * PRIME + ($description == null ? 43 : $description.hashCode());
        final Object $web_url = this.getWeb_url();
        result = result * PRIME + ($web_url == null ? 43 : $web_url.hashCode());
        final Object $current_price = this.getCurrent_price();
        result = result * PRIME + ($current_price == null ? 43 : $current_price.hashCode());
        final Object $original_price = this.getOriginal_price();
        result = result * PRIME + ($original_price == null ? 43 : $original_price.hashCode());
        final Object $start_date = this.getStart_date();
        result = result * PRIME + ($start_date == null ? 43 : $start_date.hashCode());
        result = result * PRIME + Float.floatToIntBits(this.getCoin());
        final Object $end_date = this.getEnd_date();
        result = result * PRIME + ($end_date == null ? 43 : $end_date.hashCode());
        return result;
    }

    public String toString() {
        return "AddedItem(id=" + this.getId() + ", thumbnail=" + this.getThumbnail() + ", images=" + this.getImages() + ", project_name=" + this.getProject_name() + ", purchase_notes=" + this.getPurchase_notes() + ", description=" + this.getDescription() + ", web_url=" + this.getWeb_url() + ", current_price=" + this.getCurrent_price() + ", original_price=" + this.getOriginal_price() + ", start_date=" + this.getStart_date() + ", coin=" + this.getCoin() + ", end_date=" + this.getEnd_date() + ")";
    }
}
